package com.wgl.oss.controller;

import com.wgl.oss.serivce.FileApiService;
import com.wgl.yygh.result.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author wgl
 * @version 1.0.0
 * @ClassName FileApiController.java
 * @Description TODO
 * @createTime 2022年02月10日 13:54:00
 */
@RestController
@RequestMapping("/api/oss/file")
public class FileApiController {
    @Resource
    private FileApiService fileApiService;

    @PostMapping("/fileUpload")
    public Result fileUpload(MultipartFile file){
        String url = fileApiService.upload(file);

        return Result.ok(url);
    }
}
